<%@ page  pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" language="java" import="java.sql.*" import="com.business.log.*,com.beans.log.*,com.util.*,com.config.SystemGlobals" errorPage="/error.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>日志列表</title>
<link href="../images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<form action="linklist.jsp" method="post" name="SearchForm" id="SearchForm" onsubmit="return check()">
                  <div align="left">
              搜索方式：<select name="type" >
                    <option selected value="title">标题</option>
                    <option value="no">编号</option>
                  </select> &nbsp;关键字：<input name="keyword" type="text" id="keyword" size="15">
&nbsp;
                  <input type="submit" name="Submit" value="搜索">
                  </div>
</form><SCRIPT LANGUAGE="JavaScript">
<!--
function gotopage(OtherArg){
	if (OtherArg==null || OtherArg=="null")
	{
		OtherArg="";
	}
	delfrm.action="loglist.jsp?action=gotopage"+OtherArg;
    delfrm.submit(); 
	}
function delit(){
document.delfrm.v1.value="";
if(document.delfrm.deleted.length){
	for(i=0;i<document.delfrm.deleted.length;i++){
		if(document.delfrm.deleted[i].checked){
			document.delfrm.v1.value+=document.delfrm.deleted[i].value + ",";
		}//if
	}//for
}//if
else{
if(document.delfrm.deleted.checked){
	document.delfrm.v1.value+=document.delfrm.deleted.value + ",";
	}//if
}//else
	return confirm("你要删除的日志分类编号为：" + document.delfrm.v1.value);
}
//-->
function selectidall()
{
	for(i=0;i<document.delfrm.deleted.length;i++)
	{
		document.delfrm.deleted[i].checked = !document.delfrm.deleted[i].checked;
	}
}
</SCRIPT>
<body  class="table-bg style1">
<%
	String key=(request.getParameter("keyword")==null)?"":(request.getParameter("keyword"));
		String type=(String)request.getParameter("type");
type=(type==null)?"":type;
		String pageno=null;
	if(request.getParameter("GotoPage")!=null && !request.getParameter("GotoPage").equals(""))
	{
		pageno=request.getParameter("GotoPage");
	}else
	{
		pageno=request.getParameter("pageStart");
	}

	if(pageno==null){pageno="1";}
	int firstno=Integer.parseInt(pageno);
	String sql="select link_no,link_no as '链接编号',link_name as '分类名称' ,username as '所有者' ,link_demo as '描述',isShow '是否显示' from link ";
	if(!type.equals("")){
		if(type.equals("title")){
		sql+=" where link_name like '%"+ key+"%'";
		} else if(type.equals("no")){
		sql+=" where link_no like '%"+ key+"%'";
		}
	 }
	 sql=sql+" order  by link_no desc";
	PageDisplay display = new PageDisplay();
	display.addRowClick("1"," target=\"_self\"","/admin/blog/editlink.jsp?no=");
	display.init(request,firstno,20,sql,"logtypelist.jsp?keyword="+key+"&");
	display.setFormAction("/managelink");
	String content=display.list();
%>
<%=content%>
</body>
</html>
